﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace SPLightUiHelperTest.Parent
{
    public partial class ParentUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void showPopUpButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowPopUp(UpdatePanel1, "/Pages/Chiled.aspx", "my Title", 800, 500, false, false, false);
        }

        protected void showPopUpWithRefreshButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowPopUp(UpdatePanel1, "/Pages/Chiled.aspx", "my Title", 800, 500, false, false, true);
        }

        protected void showWaitScreenButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowWaitScreen(UpdatePanel1, "My Wait Message Loading ...", null, null);
        }

        protected void getReturnedValueFromPopUpButton_Click(object sender, EventArgs e)
        {
            returnedValueFromPopUpTextBox.Text = SPLightUiHelper.UI.GetPopUpReturnedValue();
        }

        protected void addNotificationButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.AddNotification(UpdatePanel1, "My Notification");
        }

        protected void removeNotificationButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.RemoveNotification(UpdatePanel1);
        }

        protected void showMessageButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowMessage(UpdatePanel1, "My Message", "blue");
        }

        protected void showInfoMessageButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowInfoMessage(UpdatePanel1, "My Info Message");
        }

        protected void showErrorMessageButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowErrorMessage(UpdatePanel1, "Error Message");
        }

        protected void showSuccessMessageButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.ShowSuccessMessage(UpdatePanel1, "Your Opeation Succeeded");
        }

        protected void removeAllMessagesButton_Click(object sender, EventArgs e)
        {
            SPLightUiHelper.UI.RemoveAllMessages(UpdatePanel1);
        }
    }
}
